#include "Mallet.h"
#include "Ball.h"

Mallet::Mallet(Vector2D &centre,GameRectangle & arene,Ball *ball,char *couleur):
	CircleMovable(centre,20,arene),_ball(ball), _side(arene)
{
	_couleur = couleur;
}

Mallet::~Mallet(void)
{
}
void Mallet::Move(int x, int y)
{
	_direction = Vector2D(x,y)-_centre;
	if(Collision(_ball))
	{
		if(!_ball->IsMove())
			_ball->SetDirection(_direction*-1);
		else _ball->SetDirection(_ball->GetDirection()*-1 + _direction*-1);
		_ball->AddVitesse(_direction.length());
	}
	else CircleMovable::Move();
}
void Mallet::CollisionBall()
{

}